import { getStorage } from "./auth";

export function getWxLoginCode(){
	return new Promise((resolve,reject)=>{
		wx.login({
			timeout:10*1000,
			success: (res) => {
				if(res.code){
					resolve(res.code);
				}else{
					uni.showToast({
						title:'获取登录信息失败',
						mask:true
					})
					reject()
				}
			},
			fail:()=>{
				uni.showToast({
					title:'获取登录信息失败',
					mask:true
				})
				reject()
			}
		})
	})
}